<?php 
//右部文章
		$arcModel=new \Common\Model\Arc;
		$arcData=$arcModel
				->orderBy('sendtime','DESC')
				->limit(4)
				->get();
//		p($arcData);
		View::with('arcData',$arcData);
		//链接
		$linkModel=new \Common\Model\Link;
		$linkData=$linkModel->get();
//		p($linkData);
//		View::with('linkData',$linkData);
		//点击文章
		$arccData=$arcModel
				->orderBy('click','DESC')
				->limit(5)
				->get();
//		p($arccData);
//3.右侧分类
		$cateModel = new \Common\Model\Cate;
		$cateData = $cateModel->get();
		$arcModel = new \Common\Model\Arc;
//		p($cateData);
		foreach ($cateData as $k => $v) {
			$cateData[$k]['total']=$arcModel
								  ->where("category_cid={$v['cid']}")
								  ->count();
			
		}
//		p($cateData);
//网站配置
		$WebSetModel=new \Common\Model\WebSet;
		$WebSetDate=$WebSetModel
				->where("wid>2")
				->get();
//		p($WebSetData);

		$arcTagModel=new \Common\Model\ArcTag;
		$tagModel=new \Common\Model\Tag;
		$tagData=$tagModel->get();
//		p($tagData);
		foreach ($tagData as $k => $v) {
			$tagData[$k]['total']=$arcTagModel
								 ->where("tag_tid={$v['tid']}")
								 ->count();
		}
//		p($tagData);

 ?>
 	<div class="sidebar">
    <div class="news">
    	
      <h3>
        <p>最新<span>文章</span></p>
      </h3>
      <ul class="rank">
      	<?php foreach ($arcData as $v){?>
        <li><a href="<?php echo U('Content/index',array('aid'=>$v['aid']))?>" target="_blank"><?php echo $v['title']?></a></li>
		<?php }?>
      </ul>
      
      
  
      
      
      <h3 class="ph">
        <p>点击<span>排行</span></p>
      </h3>
      <ul class="paih">
      	<?php foreach ($arccData as $v){?>
        <li><a href="<?php echo U('Content/index',array('aid'=>$v['aid']))?>"  target="_blank"><?php echo $v['title']?></a></li>
        <?php }?>
      </ul>
      
       <h3>
       	<p>分类<span>集云</span></p>
      
      </h3>
      <ul class="rank">
      	<?php foreach ($cateData as $v){?>
		<a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>" target="_blank"><?php echo $v['cname']?>(<?php echo $v['total']?>)</a>
		<?php }?>
      </ul>
      
      
      <h3>
            <p><span>标签</span>集云</p>
      </h3>
      <ul class="rank">
      	<?php foreach ($tagData as $v){?>
		<a href="<?php echo U('List/index',array('tid'=>$v['tid']))?>" target="_blank"><?php echo $v['tname']?>(<?php echo $v['total']?>)</a>
		<?php }?>
      </ul>
       
      
      <h3 class="links">
        <p>友情<span>链接</span></p>
      </h3>
      <ul class="website">
      	<?php foreach ($linkData as $v){?>
        <li><a href="<?php echo $v['url']?>" target="_blank"><?php echo $v['lname']?></a></li>
        <?php }?>
      </ul>
      <div class="guanzhu">扫描二维码关注<span>栗超</span>微信账号</div>
      <div class="weixin"><img src="./Public/Home/images/2.png" style="radio:50%">
      	
      </div> 
  </div>
  </div>
  <div class="clearfloat"></div>
  <footer>
    <ul>
    <?php foreach ($WebSetDate as $v){?>
	<span class="hh"><?php echo $v['value']?></span>
    <?php }?>
    </ul>
  </footer>

</div>